var mongoose = require('mongoose');
var mongoosePaginate = require('mongoose-paginate');
var moment = require('moment');

 moment.locale('zh-cn');
  var today = {};
  var _today = moment();
  today.year = _today.format('yyyy'); /*现在的年*/
  today.date = _today.format('YYYY-MM-DD');
var schema = new mongoose.Schema({

    user:String,
    title: String,
    content:String,
    autor :String,
    ctime:{ type: Date, default: today.date  },
});
schema.plugin(mongoosePaginate);

module.exports = mongoose.model('News',  schema);  // Model.paginate()